<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>object</title>
		<script>
		  class Dog{
			  constructor(name,color="黄") {
			      this.name=name;
				  this.color=color;
			  }
			  show(){
				  alert(this.name+","+this.color);
			  }
		  }
		  class ChinaTugou extends Dog{
			  constructor(name,a=1,color="黑") {
			      super(name,color);
				  this.age=a;
			  }
			 
			  show(){
				  super.show();
				  alert("年龄"+this.age+"岁");
			  }
			  bite(n){
				  alert(this.name+"咬了"+n);
			  }
		  }
		  var d=new ChinaTugou("大黄",4,"花");
		  d.show();
		  d.bite("吕洞宾");
		  var d2=new ChinaTugou("二黄",5);
		  d2.show();
		  var d3=new ChinaTugou("3黄","白");
		  d3.show();
		  
		  console.log(d);
		</script>
	</head>
	<body>
	</body>
</html>
